using System;
using System.Collections.Generic;
using TTXNA.src.Util;
using TTXNA.src.Engine.Industries;

namespace TTXNA.src.Engine.Towns
{
    public class Town
    {

        private string townName;
        private Coordinate homeCoord;
        private List<Industry> ownedIndustries;

        public Town(string townName, Coordinate homeCoord)
        {
            this.townName = townName;
            this.homeCoord = homeCoord;
            ownedIndustries = new List<Industry>();
        }

        public void AddNewIndustry(Coordinate coord, RotateType rotType, IndustryType type)
        {
            ownedIndustries.Add(new Industry(coord, rotType, type));
        }

        public void Update(TimeSpan timePassed)
        {
            foreach (Industry i in ownedIndustries)
            {
                i.Update(timePassed);
            }
        }
    }
}
